<template>
  <div>
    <div class="title">热销推荐</div>
    <ul>
      <router-link tag="li" :to="'/detail/' + item.id" class="item" v-for="item of list" :key="item.id">
        <img class="item-img" :src="item.imgUrl">
        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <p class="item-desc">{{item.desc}}</p>
          <button class="item-button">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    list: Array
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/mixins.styl'
  .title
    margin-top .5rem
    line-height 1.9rem
    background #EEEEEE
    font-weight bold
    text-indent .4rem
  .item
    overflow hidden
    display flex
    height 6.0rem
    margin-top -.2rem
    .item-img
      width 5.5rem
      height 5.5rem
      padding .20rem
      border-radius .5rem
    .item-info
      flex 1
      padding .2rem
      min-width 0
      .item-title
        line-height 1.54rem
        font-size 1.0rem
        ellipsisi()
      .item-desc
        line-height 2.3rem
        color #7E8C8D
        font-size .9rem
        ellipsisi()
      .item-button
        background #ff9300
        padding 0 .3rem
        border-radius .06rem
  .item:first-child
    margin-top .08rem
</style>
